package ext.trace.geom;

import math.region.Surface3;

public class Geom
{
    
    public Surface3 rSurf0;
    
    public Surface3 rSurf1;
    
    public Material mMat;
    
    
    public Geom()
    {
        this.rSurf0 = null;
        this.rSurf1 = null;
        this.mMat = new Material();
    }
    
    
    public final void set(Geom aGeom)
    {
        this.rSurf0 = aGeom.rSurf0;
        this.rSurf1 = aGeom.rSurf1;
        this.mMat.set(aGeom.mMat);
    }
    
    
    public boolean equals(Object aObj)
    {
        if (!(aObj instanceof Geom))
        {
            return false;
        }
        Geom obj = (Geom) aObj;
        boolean surface = (this.rSurf0 == obj.rSurf0);
        boolean material = (this.mMat.equals(obj.mMat));
        return (surface && material);
    }
    
    
    public int hashCode()
    {
        int hash = 17;
        hash += 11 * (1 + this.mMat.mRadExit);
        hash += 13 * (12 + this.mMat.mKd);
        hash += 7 * (7 + this.mMat.mKs);
        hash += 23 * (3 + this.mMat.mReflAngle);
        return hash;
    }
    
    
    public Surface3 lerp(double t)
    {
        return this.rSurf0.lerp(this.rSurf1, t);
    }
    
}
